//
//  NetAPIClient.h
//  Normal
//
//  Created by 8b410-2 on 16/12/9.
//  Copyright © 2016年 abb. All rights reserved.
//

#import <Foundation/Foundation.h>
#import "AFNetworking.h"
#define NotificationNetError @"NotificationNetError"
typedef enum {
    Get = 0,
    Post
}NetworkMethod;

// 网络提示框的出现时机，若干秒后网络数据还未返回则出现提示框
typedef NS_ENUM(NSUInteger, NetworkRequestGraceTimeType){
    NetworkRequestGraceTimeTypeNormal,  // 0.5s
    NetworkRequestGraceTimeTypeLong,    // 1s
    NetworkRequestGraceTimeTypeShort,   // 0.1s
    NetworkRequestGraceTimeTypeNone,     // 没有提示框
    NetworkRequestGraceTimeTypeAlways   // 总是有提示框
};

typedef NS_ENUM(NSUInteger,HudShowOption) {
    HudShowOptionNone = 0,
    HudShowOptionShowSuccessHud = 1 << 0,
    HudShowOptionShowErrorHud = 1 << 1,
    HudShowOptionShowWaitHud = 1 << 2,
};
@interface NetAPIClient : AFHTTPSessionManager
+ (id)shareJsonClient;
+ (id)changeJsonClient;
- (void)requestJsonDataWithParams:(NSDictionary *)params
                   withMethodType:(NetworkMethod)method
                         andBlock:(void (^)(NSDictionary *dict, NSError *error))block;
- (void)requestJsonDataWithParams:(NSDictionary *)params
                   withMethodType:(NetworkMethod)method
                 AndHudShowOption:(HudShowOption)option
                         andBlock:(void (^)(NSDictionary *dict, NSError *error))block;
- (void)requestUploadImageWithPath:(NSString *)path
                              Name:(NSString *)name
                            Params:(NSDictionary *)params
                        ImageArray:(NSArray *)imageArray
                          AndBlock:(void (^)(NSDictionary *dict, NSError *))block;
@end
